<template>
<div class="login">
    <form name = 'form' action="">
      <div>
        <label>工号</label>
        <el-input v-model="worknum" style="width: 150px;" minlength="1" placeholder="请输入工号"></el-input>
      </div>
      <div>
        <label>密码</label>
        <el-input placeholder="请输入密码" style="width: 150px;" minlength="1" v-model="passwd" show-password></el-input>
      </div>
    </form>
    <div>
        <router-link to="/tag2"><el-button style="margin-right: 25px;" @click="chuanzhi" type="primary">登录</el-button></router-link>
        <el-button type="primary" >取消</el-button>
        <!-- <p>gogogo</p> -->
    </div>
    <tag2 v-if="isShow" :workn="workNum"></tag2>
</div>
</template>

<script>
import tag2 from '../components/tag2.vue'
export default {
  name: 'HelloWorld',
  components: {
    tag2
  },
  data () {
    return {
      worknum: '',
      passwd: '',
      isShow: false,
      workNum: 'aaa'
    }
  },
  methods: {
    chuanzhi(){
      this.$store.commit({
        type: "transmit",
        num: this.worknum
      });
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
el-input {
  width :120px;
}
label {
  margin-right: 30px;
}
div {
  margin-top: 20px;
}
</style>
